@import '../../../components/style/themes/default';
@import '../../../components/style/mixins/index';

@modal-prefix-cls: ~'@{c7n-pro-prefix}-modal';

.@{modal-prefix-cls} {
  position: fixed;
  top: 1rem;
  width: 5.2rem;
  margin: 0 auto;
  // min-height: 2.4rem;

  &-center {
    right: 0;
    left: 0;
  }

  &-fullscreen {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;

    .@{modal-prefix-cls}-footer {
      position: absolute;
      right: 0;
      bottom: 0;
      left: 0;
    }
  }

  &-content {
    position: relative;
    height: 100%;
    min-height: inherit;
    background-color: @component-background;
    background-clip: padding-box;
    border: 0;
    border-radius: @border-radius-base;
    box-shadow: @modal-content-shadow;
  }

  &-title {
    margin: 0;
    color: @heading-color;
    font-weight: 500;
    font-size: @font-size-base + 0.05rem;
    line-height: 0.24rem;
  }

  &-header {
    position: relative;
    padding: 0.15rem 0.24rem;
    color: @text-color;
    background: @component-background;
    border-radius: @border-radius-base @border-radius-base 0 0;
  }

  &-body {
    max-height: ~'calc(100vh - 1.2rem)';
    padding: 0.24rem;
    overflow: auto;
    font-size: @font-size-base;
    line-height: @line-height-base;
  }

  &-footer {
    padding: 0.12rem 0.24rem;
    text-align: right;
    border-radius: 0 0 @border-radius-base @border-radius-base;

    button + button {
      margin-bottom: 0;
      margin-left: 0.08rem;
    }

    &-drawer {
      position: absolute;
      bottom: 0;
      width: 100%;
      text-align: left;
    }

    &-without-border {
      padding-top: 0;
      border-top: none;
    }
  }

  &-container {
    position: absolute;
    top: 0;
    left: 0;
    z-index: @zindex-modal-container;
  }

  &-active {
    z-index: 3;
  }

  &-drawer {
    top: 0;
    right: 0;
    left: unset;
    height: 100vh;
    transition: margin-right @animation-duration-slow @ease-in-out;
  }

  &-drawer &-header,
  &-border &-header {
    border-bottom: @border-width-base @border-style-base @border-color-base;
  }

  &-drawer &-footer,
  &-border &-footer {
    border-top: @border-width-base @border-style-base @border-color-base;
  }

  &-header-buttons {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
  }

  &-header-button {
    width: 0.55rem;
    height: 100%;
    padding: 0;
    color: @text-color-secondary;
    font-weight: 700;
    font-size: @font-size-lg;
    line-height: 1;
    text-decoration: none;
    background: transparent;
    border: 0;
    outline: 0;
    cursor: pointer;
    transition: color 0.3s;

    &:focus,
    &:hover {
      color: #444;
    }
  }

  &-movable {
    cursor: move;
    user-select: none;
  }
}

.@{c7n-pro-prefix}-confirm {
  &-icon {
    padding-right: 0.16rem;
    vertical-align: top;

    .@{iconfont-css-prefix} {
      font-size: 0.24rem;
      line-height: 1.5;
    }
  }

  &-info {
    color: @info-color;
  }

  &-confirm,
  &-warning {
    color: @warning-color;
  }

  &-success {
    color: @success-color;
  }

  &-error {
    color: @error-color;
  }

  &-title {
    overflow: auto;
    color: @heading-color;
    font-weight: 500;
    font-size: @modal-font-size-lg;
    line-height: 0.32rem;
  }

  &-content {
    color: @text-color;
    font-size: @font-size-base;
  }

  &-title + &-content {
    margin-top: 0.08rem;
  }
}

.@{c7n-pro-prefix}-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  background-color: @modal-mask-bg;
}
